package com.trumeen.immichgallery.network

import com.trumeen.immichgallery.model.*
import com.trumeen.immichgallery.model.PersonResponse
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

interface ImmichService {
    @POST("auth/login")
    suspend fun login(@Body request: LoginRequest): Response<LoginResponse>

    @POST("auth/logout")
    suspend fun logout(@Header("Authorization") token: String): Response<Unit>

    @GET("server/ping")
    suspend fun pingServer(): Response<Unit>

    @GET("memories")
    suspend fun getOnThisDayAssets(@Query("for") dataTime: String): Response<List<MemoriesResponseItem>>

    @GET("people")
    suspend fun getAllPeople(
        @Query("page") page: Int = 1,
        @Query("size") size: Int = 1000,
        @Query("withHidden") withHidden: Boolean = false
    ): Response<PersonResponse>

    @GET("people/{personId}/time-buckets")
    suspend fun getTimeBuckets(@Path("personId") personId: String): Response<List<String>>

    @GET("people/{personId}/time-bucket")
    suspend fun getTimeBucket(
        @Path("personId") personId: String,
        @Query("timeBucket") timeBucket: String
    ): Response<List<MemoriesResponseItem>>
}